
package core.simple;

public class Indyvidual implements Comparable<Indyvidual> {
	double [] genotype;
	double [] results = new double[2];
	double fitness = -1;
	//liczba osobnikow zdominowanych przez biezacego - strength
	int strength = 0;
	//liczba osobnikow dominujacych nad biezacym - rawFitness
	int rawFitness = 0;
	//gestosc
	double density = 0;
	//odleglosci
	double [] distances;
	
	public Indyvidual(double[] genotype){
		this.genotype = genotype;
		
	}
	public Indyvidual(double[] genotype,double fitness,double[] results){
		this.genotype = genotype;
		this.fitness = fitness;
		this.results = results;
	}
	public double getFitness(){

		return this.fitness;
	}
	public int compareTo(Indyvidual i){
		
		if (this.fitness < i.fitness)
			return -1;
		else if (this.fitness > i.fitness)
			return 1;
		else
			return 0;
	}

}
